<!DOCTYPE html>
<html lang="charset">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    // function add(num1 = 2, num2 = 3) {
    //     document.write(num1 + num2);
    // }
    // add(3, 8);

    function addArray(arr = []) {
        let sum = 0;
        for (let i = 0; i < arr.length; i++) {
            // document.write(arr[i] + "--");
            // sum = sum + arr[i]
            sum += arr[i];
        }
        document.writeln("数组的和是：" + sum)
    }
    addArray([1, 3, 5, 7]);

    function back(numa, numb) {
        // document.write(numa * numb);
        return numa * numb;
        document.write("adsadasdsda" + numa);
    }

    let num;
    num = back(2, 8) + 2;
    alert(num);
    // back(3, 5);
</script>